﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using H2.NET.Web.Workflow.Models;

namespace H2.NET.Web.Workflow.UserControls
{
    public partial class Toolbar : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                UserSession us = Session["UserSession"] as UserSession;
                var mid = Request.QueryString["mid"];
                if (mid != null)
                {
                    rpt_toolbar.DataSource = us.Permissions.Where(t => t.ParentID == Convert.ToInt32(mid)).ToList();
                    rpt_toolbar.DataBind();
                }
            }
            catch (Exception ee)
            {
                TaskDB.Log("", false, "调用 Toolbar.ascx 页面 Page_Load 事件出错：" + ee.Message);
            }
        }
    }
}